using System;
namespace AppToolKit.Business
{
	public class ExecuteResultBase : IEquatable<ExecuteResultBase>
	{
		public int Code
		{
			get;
			set;
		}
		public string Descript
		{
			get;
			set;
		}
		public EventHandler DoDelegate
		{
			get;
			set;
		}
		public bool Equals(ExecuteResultBase obj)
		{
			return !object.ReferenceEquals(null, obj) && (object.ReferenceEquals(this, obj) || obj.Code == this.Code);
		}
		public override bool Equals(object obj)
		{
			return !object.ReferenceEquals(null, obj) && (object.ReferenceEquals(this, obj) || (obj.GetType() == typeof(ExecuteResultBase) && this.Equals((ExecuteResultBase)obj)));
		}
		public override int GetHashCode()
		{
			return this.Code;
		}
		public static bool operator ==(ExecuteResultBase left, ExecuteResultBase right)
		{
			return object.Equals(left, right);
		}
		public static bool operator !=(ExecuteResultBase left, ExecuteResultBase right)
		{
			return !object.Equals(left, right);
		}
		public void Do()
		{
			if (this.DoDelegate != null)
			{
				this.DoDelegate(this, null);
				return;
			}
			throw new NotImplementedException(string.Format("{0}do没有定义", base.GetType().FullName));
		}
	}
}
